package io.fivefire.base.common.enums;

import java.util.List;

/**
 * <p> </p>
 *
 * @author huijun
 * @create 2018-06-14 上午 12:15
 **/
public enum OperatorEnum implements IndexedEnum {
    INSERT(1, "insert"),

    UPDATE(2, "update");

    private static final List<OperatorEnum> INDEXES = IndexedEnumUtil.toIndexes(OperatorEnum.values());
    private int code;
    private String desc;

    OperatorEnum(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public static OperatorEnum codeOf(final int code) {
        return IndexedEnumUtil.valueOf(INDEXES, code);
    }

    public int getCode() {
        return code;
    }

    @Override
    public String getName() {
        return desc;
    }

    public String getDesc() {
        return desc;
    }
}

